package test01;

public class test3_Runnable {
    public static void main(String[] args) {
        MyRunnable01 myRunnable01=new MyRunnable01();
        MyRunnable02 myRunnable02=new MyRunnable02();
        Thread thread01=new Thread(myRunnable01);
        Thread thread02=new Thread(myRunnable01);
        Thread thread03=new Thread(myRunnable02);
        thread01.start();
        thread02.start();
        thread03.start();
    }
    static class MyRunnable01 implements Runnable{
        public void run() {
            while (true) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("产生服装,金币+50");
            }
        }
    }
  static class MyRunnable02 implements Runnable{

        public void run() {
            while (true) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("产生墨镜，金币+10");
            }
        }
    }
}
